package main

import (
	"fmt"
)

func main() {
	fmt.Println(add(1, 2, 3, 4))
	a := [...]int{12, 32, 12}
	fmt.Println(a, len(a), cap(a))

	fmt.Println("--------------------")
	var arr1 = []int{1, 2, 3}
	var arr2 = []int{4, 5, 6}
	var arr3 = []int{7, 8, 9}
	arr4 := append(append(arr1, arr2...), arr3...)
	fmt.Println(arr4)

}

func add(a ...int) int {
	sum := 0
	for _, v := range a {
		sum += v
	}
	return sum
}
